﻿<UserControl x:Class="FileExplorer.WPF.Views.ToolbarView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:uc="clr-namespace:FileExplorer.WPF.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FileExplorer3.WPF;component/Themes/Default/Brushes.xaml" />
                <ResourceDictionary Source="pack://application:,,,/FileExplorer3.WPF;component/Themes/Common/Toolbar.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
        
    <Grid Height="20">
        
        <uc:ToolbarEx ItemsSource="{Binding Commands.All}">
            <!-- This is obsoluted, move to FileListView -->
            <uc:ToolbarEx.ItemContainerStyle>
                <Style TargetType="{x:Type uc:ToolbarItemEx}" 
                       BasedOn="{StaticResource ToolbarItemExStyle}" >
                    <Setter Property="Header" Value="{Binding CommandModel.Header, Mode=OneWay}"  />
                    <Setter Property="Symbol" Value="{Binding CommandModel.Symbol, Mode=OneWay}"  />
                    <Setter Property="HeaderType" Value="{Binding CommandType, Mode=OneWay}" />                    
                    <Setter Property="ItemsSource" Value="{Binding SubCommands}" />
                    <Setter Property="IsHeaderVisible" Value="{Binding CommandModel.IsHeaderVisible, Mode=TwoWay}" />
                    <!--<Setter Property="AllowDrop" Value="True" />-->
                    <!--<Setter Property="def:UIEventHubProperties.DragItemTemplate" Value="{StaticResource GridLabelTemplate}" />-->
                </Style>
            </uc:ToolbarEx.ItemContainerStyle>

            <!--<uc:ToolbarItemEx HeaderType="Button" Header="Button" Symbol="&#xE102;"  />
            <uc:ToolbarItemEx HeaderType="Button" Header="Button" Symbol="&#xE103;" />
            <uc:ToolbarItemEx x:Name="tbiMenu1" Command="Close" HeaderType="MenuButton" Header="Close" Symbol="&#xE106; " />-->
        </uc:ToolbarEx>
        <ContentControl Content="{Binding}" />
    </Grid>
</UserControl>
